<template>
      <div id="main" style="width: 600px;height:400px;"></div>
</template>
 
<script>
  /*默认数据*/
  const DEFAULT_DATA = {
    xAxisData: ["重庆", "西安", "福州", "杭州", "长沙", "南昌"],
    yAxisData: [43, 41.8, 41.7, 41.6, 40.6, 40.6],
  };
  export default {

    data() {
      return {
        msg: 'Welcome to Your Vue.js App',
      }
    },
    mounted() {
      this.drawLine();
    },
    methods: {
      drawLine() {
        var myChart = this.$echarts.init(document.getElementById('main'));
        // 指定图表的配置项和数据
        var option = {
            title: {
                text: 'ECharts 入门示例'
            },
            tooltip: {},
            legend: {
                data:['销量']
            },
            xAxis: {
                data: ["衬衫","羊毛衫","雪纺衫","裤子","高跟鞋","袜子"]
            },
            yAxis: {},
            series: [{
                name: '销量',
                type: 'bar',
                data: [5, 20, 36, 10, 10, 20]
            }]
        };
        // 使用刚指定的配置项和数据显示图表。
        myChart.setOption(option);
      }
    },
  }
</script>
 
<style scoped>
 
</style>